package org.fhm.zdte.common.standard;

import java.util.function.BiConsumer;

/**
 * The interface {@link IDataDeal} that is used to deal data.
 *
 * @param <R> The identification of data processing consumer.
 * @param <N> The first parameter for the data processing consumer.
 * @param <E> The second parameter for the data processing consumer.
 * @author 谭波
 * @since 2024/1/31
 */
public interface IDataDeal<R, N, E> {

    /**
     * Add the data processing consumer.
     *
     * @param r          The identification of data processing consumer.
     * @param biConsumer The data processing consumer.
     * @return Data processor
     */
    IDataDeal<R, N, E> putConsumer(R r, BiConsumer<N, E> biConsumer);

    /**
     * Obtain the identification of data processing consumer, perform data processing。
     *
     * @param n The first parameter for the data processing consumer.
     * @param e The second parameter for the data processing consumer.
     */
    void consume(N n, E e);

}
